package cm.tl.pms.enums.base;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 待审核
 * 初审中
 * 初审失败
 * 复审失败
 * 复审中
 * 初审成功
 * 复审成功
 * 草稿
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum BizTypeEnum implements IEnum {
    WAIT_TODO("草稿", 0),
    WAIT_APPROVE("待审核", 1),
    FIRST_APPROVE("初审中", 20),
    FIRST_APPROVE_FAIL("初审失败", 21),
    FIRST_APPROVE_OK("初审成功", 22),
    SECOND_APPROVE("复审中", 30),
    SECOND_APPROVE_FAIL("复审失败", 31),
    SECOND_APPROVE_OK("复审成功", 32);
    private final String name;
    private final Integer value;

    public static BizTypeEnum nameOf(Integer value) {
        for (BizTypeEnum e : BizTypeEnum.values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }
}
